<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
  	<base href="<%=basePath%>">
    <meta http-equiv=Content-Type content="text/html;charset=utf-8">
    <title>更新员工信息</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    	
    <link rel="stylesheet" type="text/css" href="js/lib/bootstrap/css/bootstrap.css">
    
    <link rel="stylesheet" type="text/css" href="css/stylesheets/theme.css">
    <link rel="stylesheet" href="js/lib/font-awesome/css/font-awesome.css">
    <link href="js/prettify/prettify.css" type="text/css" rel="stylesheet"/>

    <script src="js/lib/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/lhgcore.min.js"></script>
	<script type="text/javascript" src="js/lhgcalendar.min.js"></script>
	<script type="text/javascript" src="js/prettify/prettify.js"></script>
	    <script src="js/lib/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript">

        $("[rel=tooltip]").tooltip();
        $(function() {
            $('.demo-cancel-click').click(function(){return false;});
        });
             	

        function opcal(){
            J.calendar.Show();
        }
        

        function stopEvent(ev){
            ev.stopPropagation ? ev.stopPropagation() : (ev.cancelBubble = true);
        }
        
    	window.onload=selectSex;
    	function selectSex(){
    		document.getElementById("sex").value=document.getElementById("sexList").value;
    	}
    	
    	window.onload=selectDept;
    	function selectDept(){
    		document.getElementById("dname").value=document.getElementById("deptList").value;
    	}
    	
    	window.onload=selectStatus;
    	function selectStatus(){
    		document.getElementById("status").value=document.getElementById("statusList").value;
    	}
    	
    	// 验证输入不为空的脚本代码
    	function checkForm(form) {
    		if (form.ename.value == "") {
    			alert("请输入姓名!");
    			form.ename.focus();
    			return false;
    		}
    		if (form.sex.value == "") {
    			alert("请选择性别!");
    			form.sex.focus();
    			return false;
    		}
    		alert("更新员工信息成功！");
    		return true;
    	}
    </script>
	

    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .brand { font-family: georgia, serif; }
        .brand .first {
            color: #ccc;
            font-style: italic;
        }
        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>

  </head>

  <body class=""> 
    
    <div class="navbar">
        <div class="navbar-inner">
                <ul class="nav pull-right">
                    
                    <li><a href="#" class="hidden-phone visible-tablet visible-desktop" role="button">Settings</a></li>
                    <li id="fat-menu" class="dropdown">
                        <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="icon-user"></i> Jack Smith
                            <i class="icon-caret-down"></i>
                        </a>

                        <ul class="dropdown-menu">
                            <li><a tabindex="-1" href="#">My Account</a></li>
                            <li class="divider"></li>
                            <li><a tabindex="-1" class="visible-phone" href="#">Settings</a></li>
                            <li class="divider visible-phone"></li>
                            <li><a tabindex="-1" href="sign-in.html">Logout</a></li>
                        </ul>
                    </li>
                    
                </ul>
                <a class="brand" href="index.html"><span class="first">Your</span> <span class="second">Company</span></a>
        </div>
    </div>
    


    
    <div class="sidebar-nav">
		<a href="#dashboard-menu" class="nav-header" data-toggle="collapse"><i
			class="icon-dashboard"></i>欢迎使用</a>
		<ul id="dashboard-menu" class="nav nav-list collapse in">
			<li><a href="<%=basePath%>jsp/index.jsp">主页</a></li>
			<li><a href="<%=basePath%>html/map.jsp">地图</a></li>
		</ul>

        <a href="#accounts-menu" class="nav-header" data-toggle="collapse"><i class="icon-github"></i>部门管理<i class="icon-chevron-up"></i></a>
        <ul id="accounts-menu" class="nav nav-list collapse">
            <li ><a href="<%=basePath%>department/list">部门列表</a></li>
            <li ><a href="<%=basePath%>jsp/add_department.jsp">添加部门</a></li>
        </ul>

        <a href="#error-menu" class="nav-header collapsed" data-toggle="collapse"><i class="icon-user"></i>员工管理 <i class="icon-chevron-up"></i></a>
        <ul id="error-menu" class="nav nav-list">
            <li><a href="<%=basePath%>employee/list">员工列表</a></li>
            <li ><a href="<%=basePath%>employee/department/list">添加员工</a></li>
        </ul>

        <a href="#legal-menu" class="nav-header" data-toggle="collapse"><i class="icon-legal"></i>文件管理</a>
        <ul id="legal-menu" class="nav nav-list collapse">
            <li ><a href="<%=basePath%>jsp/manage_file.jsp">上传文件</a></li>
            <li ><a href="<%=basePath%>file/listFile">文件列表</a></li>
        </ul>

        <a href="help.html" class="nav-header" ><i class="icon-question-sign"></i>帮助</a>
    </div>
    

    
    <div class="content">
        
        <div class="header">
            
            <h1 class="page-title">更新员工</h1>
        </div>
        
        <ul class="breadcrumb">
            <li><a href="index.html">主页</a> <span class="divider">/</span></li>
            <li><a href="<%=basePath%>employee/list">员工列表</a> <span class="divider">/</span></li>
            <li class="active">更新员工</li>
        </ul>

        <div class="container-fluid">
            <div class="row-fluid">
                    
<div class="well">
    <ul class="nav nav-tabs">
      <li class="active"><a href="#home" data-toggle="tab">Profile</a></li>
      <!--<li><a href="#profile" data-toggle="tab">Password</a></li>-->
    </ul>
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
		<form id="tab" action="<%=basePath%>employee/update" method="post" onsubmit="return checkForm(this);">
			<label>id</label>
        	<input type="text" readonly="readonly" id="eid" name="eid" value="${eid}" class="input-xlarge" />
			<label>员工编号</label>
        	<input type="text" readonly="readonly" id="eno" name="eno" value="${eno}" class="input-xlarge" />
			<label>姓名</label> 
			<input type="text" id="ename" name="ename" value="${ename}" class="input-xlarge" /> 
			<label>性别</label> 
			<select id="sexList" class="input-xlarge" onchange="selectSex()">
			 <option style="displty:none" selected>--请选择--</option> 
			<option value="男" selected="selected">男</option>
			<option value="女">女</option>
			</select>
			<input type="hidden" id="sex" name="sex"/>
			<label>生日</label> 
			<input type="text" id="birthday" name="birthday" value="${birthday}" readonly="readonly" class="input-xlarge" onclick="opcal()" /> 
			<label>入职时间</label> <input type="text" id="joinDate" name="joinDate" value="${joinDate}" readonly="readonly" class="input-xlarge" onclick="opcal()" /> 
			<label>所属部门</label>
			<select id="deptList" class="input-xlarge" onchange="selectDept()">
			<c:forEach items="${list}" var="list">
				<option value="${list.dname}">${list.dname}</option>
			</c:forEach>
			</select>
			<input type="hidden" id="dname" name="dname"/>
			<label>状态</label>
			<select id="statusList" class="input-xlarge" onchange="selectStatus()">
			<option value="0" selected="selected">0</option>
			<option value="1">1</option>
			<option value="2">2</option>
			</select>
			<input type="hidden" id="status" name="status"/></br/>
			<input type="submit" name="" class="btn btn-primary" value="保存" />
			</form>
			
      </div>
      <div class="tab-pane fade" id="profile">
      </div>
  </div>
</div>


                    
                    <footer>
                        <hr>

                        <!-- Purchase a site license to remove this link from the footer: http://www.portnine.com/bootstrap-themes -->
                        <p class="pull-right">A <a href="http://www.portnine.com/bootstrap-themes" target="_blank">Free Bootstrap Theme</a> by <a href="http://www.portnine.com" target="_blank">Portnine</a></p>

                        <p>&copy; 2012 <a href="http://www.portnine.com" target="_blank">Portnine</a></p>
                    </footer>
                    
            </div>
        </div>
    </div>
    
    
  </body>
</html>


